from base.java.exception.NullPointerException import NullPointerException

def isSimpleString(node):
    if node is None:
        raise NullPointerException
    if not node.isLiteral():
        return False
    dt = node.getLiteralDatatype()
    if dt is None:
        return not isLangString(node)
    return False

def isLangString(node):
    if node is None:
        raise NullPointerException
    if not node.isLiteral():
        return False
    lang = node.getLiteralLanguage()
    if lang is None:
        return False
    return not lang == ""
